import request from '@/utils/request'

// 查询gptkey列表
export function listKey(query) {
  return request({
    url: '/ai/gpt/list',
    method: 'get',
    params: query
  })
}

// 查询gptkey详细
export function getKey(id) {
  return request({
    url: '/ai/gpt/' + id,
    method: 'get'
  })
}

// 新增gptkey

export function addKey(data) {
  return request({
    url: '/ai/gpt',
    method: 'post',
    data: data
  })
}

// 修改gptkey

export function updateKey(data) {
  return request({
    url: '/ai/gpt',
    method: 'put',
    data: data
  })
}

// 删除gptkey

export function delKey(id) {
  return request({
    url: '/ai/gpt/' + id,
    method: 'delete'
  })
}


export function chat(data){
    return request({
        url:'/ai/gpt/chat',
        method:'post',
        data
    })
}